package com.service.impl;

import com.mapper.UserMapper;
import com.pojo.Petmaster;
import com.pojo.Raising;
import com.pojo.RoleUser;
import com.pojo.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Zhengjz
 * @version 1.0
 * @className UserServiceimpl
 * @date 2021/3/1 12:45
 */
@Service
public class UserServiceimpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User findByName(String name) {
        return userMapper.findByName(name);
    }

    @Override
    public User findById(String name) {
        return userMapper.findById(name);
    }

    @Override
    public Boolean findName(String name) {
        User user = userMapper.findName(name);
        if(user != null){
            return true;
        }
        return false;
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int addPetmaster(Petmaster petmaster) {
        return userMapper.addPetmaster(petmaster);
    }

    @Override
    public User selById(String userName) {
        return userMapper.selById(userName);
    }

    @Override
    public List<Petmaster> findPetmaster() {
        return userMapper.findPetmaster();
    }

    @Override
    public int delPetUser(String id) {
        return userMapper.delPetUser(id);
    }

    @Override
    public List<Petmaster> selectPetmaster(String name) {
        return userMapper.selectPetmaster(name);
    }

    @Override
    public RoleUser findRoleUser(String userId) {
        return userMapper.findRoleUser(userId);
    }

    @Override
    public int addroleId(RoleUser roleUser) {
        return userMapper.addroleId(roleUser);
    }


}
